<%- include('./layouts/header.ejs')%>

<div class="main">
  <%- include('./layouts/navBar.ejs')%>
  <div class="container-fluid">
    <div class="jumbotron text-center">
      <h1>One Belt, One Road</h1>
      <p>Thoughts, stories and ideas.</p>
      <p>
        <a class="btn btn-primary btn-lg" href="post-add.html" role="button"
          >写文章</a
        >
      </p>
    </div>
    <div class="row">
      <div class="col-md-4">
        <div class="panel panel-default">
          <div class="panel-heading">
            <h3 class="panel-title">站点内容统计：</h3>
          </div>
          <ul class="list-group">
            <li class="list-group-item">
              <strong><%= postsCount%></strong>篇文章（<strong
                ><%= draftedCount%></strong
              >篇草稿）
            </li>
            <li class="list-group-item">
              <strong><%= categoriesCount%></strong>个分类
            </li>
            <li class="list-group-item">
              <strong><%= commentsCount%></strong>条评论（<strong
                ><%= heldCount%></strong
              >条待审核）
            </li>
          </ul>
        </div>
      </div>
      <div class="col-md-4"></div>
      <div class="col-md-4"></div>
    </div>
  </div>
</div>
<%- include('./layouts/aside.ejs')%> <%- include('./layouts/footer.ejs')%>

<script>
  let url = "https://maps.googleapis.com/maps/api/place/findplacefromtext/json";
  let urls = "http://119.23.61.38:3000/index";
  // 1. 发请求获取当前id下面的数据，渲染在页面上
  $.ajax({
    type: "get",
    url: urls,
    // data: {
    //   input: "Museum of Contemporary Art Australia",
    //   inputtype: "textquery",
    //   fields: "photos,formatted_address,name,rating,opening_hours,geometry",
    //   key: "AIzaSyC4t2-gKkCYWCrgcv5EW50tVAhojCM-tWc",
    // },
    dataType: "html",
    success: function (res) {
      debugger;
      console.log(res);
    },
  });
</script>
